Skip to content

Implement DynamoDbFlatten annotation #3833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 5, 2025

Conversation

irina-herciu
Copy link
Contributor

@irina-herciu irina-herciu commented May 21, 2025

Implement DynamoDbFlatten annotation

Description

Introduce the [DynamoDbFlatten] attribute, enabling developers to flatten complex nested types into their parent objects in DynamoDB, mirroring the behavior of Java SDK’s @DynamoDbFlattenDynamoDB Object Mapping. This allows for simpler, flat table schemas while maintaining clean object models in code.

Java DynamoDbFlatten

 [DynamoDBTable("HashTable")]
 public class EmployeeNonFlat
 {
     [DynamoDBHashKey("Id")]
     public int EmployeeId { get; set; }

     [DynamoDBFlatten]
     public ContactInfo Contact { get; set; }
 }

 public class ContactInfo
 {
     public string Email { get; set; }

     [DynamoDBFlatten]
     public Address Address { get; set; }
 }

Motivation and Context

Testing

Integration test added
Unit test to be added for internal methods

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

add new attribute and update write item flow
fix flattened properties issue
@normj
Copy link
Member

normj commented May 21, 2025

Is there an ask for this feature or is this parity feature with the Java SDK?

@irina-herciu
Copy link
Contributor Author

Is there an ask for this feature or is this parity feature with the Java SDK?

this is for feature parity with Java SDK

@irina-herciu irina-herciu marked this pull request as ready for review May 22, 2025 15:25
@AlexDaines AlexDaines requested a review from normj May 22, 2025 15:26
@peterrsongg peterrsongg requested a review from GarrettBeatty May 22, 2025 17:25
@normj
Copy link
Member

normj commented Jun 3, 2025

With your other PR's merged there are now conflicts with this PR that need to be addressed.

@normj
Copy link
Member

normj commented Jun 4, 2025

PR looks good. I kicked off the internal validation build.

@normj
Copy link
Member

normj commented Jun 4, 2025

Dry run DRY_RUN-5611e6aa-4bfc-484e-a9d5-0e0c53946515 successful

@dscpinheiro dscpinheiro merged commit a6f9e36 into aws:development Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants